<?php

    //获得图片id和商品名
    $goods_id = $_GET['goods_id'];
    //获得商品名
    $sql = "select gname from ". PRE ."goods where id = '$goods_id' limit 1";
    $gname = getRow($link, $sql);
    $gname = $gname['gname'];

    $sql = "select * from ". PRE ."image where goods_id = '$goods_id' and cover=1 limit 1";
    $res = getRow($link,$sql);

?>

<div class="container mt50">
    <div class="row mt20 col-md-4">
        <div class="row">
            <h3 class="text-center"><b><?php echo $gname?></b></h3>
        </div>
        <div class="row">
            <img src="<?php echo get_img_url(ROOT_URL.'upload',$res['iname'],350)?>">
        </div>
    </div>
    <div class="row mt50 col-md-7">
        <form class="form-validate form-horizontal mt50" id="register_form" method="post" action="<?php echo ROOT_URL?>com/buydo.php?act=evaluate" enctype="multipart/form-data">
            <input type="hidden" name="goods_id" value="<?php echo $goods_id?>">
            <div class="form-group mt30">
                <label for="msg" class="control-label col-md-2">图片 <span class="required">*</span></label>
                <div class="col-md-10">
                    <input type="file" name="myfile">
                </div>
            </div>

            <div class="form-group mt50">
                <label for="msg" class="control-label col-md-2">评论内容 <span class="required">*</span></label>
                <div class="col-md-10">
                    <textarea name="evaluate"  class="form-control" rows="5"></textarea>
                </div>
            </div>

            <div class="form-group mt50">
                <div class="col-md-offset-2 col-md-10">
                    <button class="btn btn-primary" type="submit">提交评论</button>
                    <button class="btn btn-default" type="reset">重置</button>
                    <a href="<?php $_SERVER['HTTP_REFERER']?>"><button class="btn btn-info pull-right" type="button">取消</button></a>
                </div>
            </div>
        </form>
        <br>

    </div>
</div>
